package com.free.netty;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;

/**
 * 通道初始化
 *
 * @Author: hao.ding@insentek.com
 * @Date: 2021-10-29 13:44:41
 */
public class NettyChannelInitializer<SockeetChannel> extends ChannelInitializer<Channel> {

    @Override
    protected void initChannel(Channel ch) throws Exception {
        ch.pipeline().addLast("encoder", new StringEncoder());
        ch.pipeline().addLast("decoder", new StringDecoder());
        ch.pipeline().addLast(new BootNettyChannelInboundHandlerAdapter());
    }
}
